import {ChangeLoading} from "../constant";

// 初始化状态
const initState = { isLoading: false}

export default function LoadingReducer(preState = initState, action){
    const {type, payload} = action
    switch (type){
        case ChangeLoading:
            let newState = {...preState}
            newState.isLoading = payload
            return newState
        default:
            return preState
    }
}